
package com.carkeeper.search.listener;


import com.carkeeper.search.config.RabbitMQConfig;
import com.carkeeper.search.service.EsManagerService;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//上架监听类
@Component
public class ServiceUpListener {
    @Autowired
    private EsManagerService esManagerService;
    @RabbitListener(queues = RabbitMQConfig.SEARCH_ADD_QUEUE)
    public void getMessage(String message){
        System.out.println(message);
        esManagerService.importDataToESByServiceId(Long.parseLong(message));

    }

}

